<HTML>
<HEAD>
<TITLE>ncftpput(1) manual page</TITLE>
</HEAD>
<BODY bgcolor=white>

<H2>Name</H2>
<blockquote>
  <b>
ncftpput</b> - Internet file transfer program for scripts
</blockquote>
<H2>Synopsis</H2>
<blockquote>
<P>
<B>ncftpput</B>
[<I>options</I>]<I></I> <I>remote-host remote-directory local-files...</I>
<P>
<B>ncftpput</B>
[<I>options</I>]<I></I> <I>bookmark-name remote-directory local-files...</I>
<P>
<B>ncftpput</B> <tt>-f</tt> <I>login.cfg</I>
[<I>options</I>] <I>remote-directory local-files...</I>
<P>
<B>ncftpput</B> <tt>-c</tt> <I>remote-host remote-path-name</I> <tt>&lt; stdin</tt>  
<P>
<B>ncftpput</B> <tt>-C</tt> <I>remote-host local-path-name remote-path-name</I>
</blockquote>

<center>
<p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="5JS76LUNSD3HU">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</center>

<H2>Options</H2>
 Command line flags:
<blockquote>
<DL>

<DT><B>-u </B><I>XX</I> </DT>
<DD>Use username <I>XX</I> instead of anonymous.
</DD>

<DT><B>-p </B><I>XX</I> </DT>
<DD>Use password <I>XX</I> with the username. </DD>

<DT><B>-P </B><I>XX</I> </DT>
<DD>Use port number <I>XX</I> instead
of the default FTP service port (21). </DD>

<DT><B>-j </B><I>XX</I> </DT>
<DD>Use account <I>XX</I> in supplement
to the username and password (deprecated). </DD>

<DT><B>-d </B><I>XX</I> </DT>
<DD>Use the file <I>XX</I> for debug
logging. </DD>

<DT><B>-a</B> </DT>
<DD>Use ASCII transfer type instead of binary. </DD>

<DT><B>-m</B> </DT>
<DD>Attempt to make the
remote destination directory before copying. </DD>

<DT><B>-t </B><I>XX</I> </DT>
<DD>Timeout after <I>XX</I> seconds.
</DD>

<DT><B>-U </B><I>XX</I> </DT>
<DD>Use value <I>XX</I> for the umask. </DD>

<DT><B>-v</B>/<B>-V</B> </DT>
<DD>Do (do not) use progress meters. The
default is to use progress meters if the output stream is a TTY. </DD>

<DT><B>-f </B><I>XX</I> </DT>
<DD>Read
the file <I>XX</I> for host, user, and password information. </DD>

<DT><B>-c</B> </DT>
<DD>Read locally from standard input and write remotely to specified pathname.</DD>

<DT><B>-C</B> </DT>
<DD>Similar to <b>-c</b>, except a local pathname is specified rather than reading from standard input.</DD>

<DT><B>-A</B> </DT>
<DD>Append to remote
files, instead of overwriting them. </DD>

<DT><B>-T </B><I>XX</I> </DT>
<DD>Upload into temporary files prefixed
by <I>XX</I>. </DD>

<DT><B>-S </B><I>XX</I> </DT>
<DD>Upload into temporary files suffixed by <I>XX</I>. </DD>

<DT><B>-R</B> </DT>
<DD>Recursive mode;
copy whole directory trees. </DD>

<DT><B>-r </B><I>XX</I> </DT>
<DD>Redial a maximum of  <I>XX</I> times until connected
to the remote FTP server. </DD>

<DT><B>-z</B>/<B>-Z</B> </DT>
<DD>Do (do not) try to resume transfers. The default
is to <I>not</I> try to resume (-Z). </DD>

<DT><B>-E</B> </DT>
<DD>Use regular (PORT) data connections. </DD>

<DT><B>-F</B> </DT>
<DD>Use passive (PASV) data connections.&nbsp; The default is to use passive, but to fallback to
  regular if the passive connection fails or times out. </DD>

<DT><B>-DD</B> </DT>
<DD>Delete
local file after successfully uploading it. </DD>

<DT><B>-y</B> </DT>
<DD>Try using "SITE UTIME" to
preserve timestamps on remote host. Not many remote FTP servers support
this, so it may not work. </DD>

<DT><B>-b</B> </DT>
<DD>Run in background (by submitting a job to <I>ncftpbatch</I>).
</DD>

<DT><B>-bb</B> </DT>
<DD>
Similar to <b>-b</b> option, but only submits the batch
job. You will need to run <i>ncftpbatch</i> for the
batch job to be processed. This is useful if you
already have a <i>ncftpbatch</i> process running, or wish
to have better control of when batch jobs are processed.
<P>
For example, if you wanted to do background processing
of three files all on the same remote
server, it is more polite to use just one <i>ncftpbatch</i>
process to process the three jobs sequentially,
rather than having three <i>ncftpbatch</i> processes open
three simultaneous FTP sessions to the same server.
</DD>

<DT><B>-B </B><I>XX</I> </DT>
<DD>Try setting the TCP/IP socket buffer size to <I>XX</I> bytes.  </DD>
</DL>

<DT><B>-W </B><I>XX</I> </DT>
<DD>Send raw FTP command <I>XX</I> after logging in.</DD>

<DT><B>-X </B><I>XX</I> </DT>
<DD>Send raw FTP command <I>XX</I> after each file transferred.</DD>

<DT><B>-Y </B><I>XX</I> </DT>
<DD>
Send raw FTP command <I>XX</I> before logging out.
<P>
The <B>-W</B>, <B>-X</B>, and <B>-Y</B> options are useful for advanced
users  who need to tweak behavior on some servers.
For example, users accessing mainframes might need
to  send  some special SITE commands to set blocksize
and record format information.
<P>
For these options, you can use them multiple times
each if you need to send multiple commands.
For the
<B>-X</B> option, you can use the  cookie <TT>%s</TT>  to  expand
into the name of the file that was transferred.
</DD>

<DT><B>-o </B><I>XX</I> </DT>
<DD>Set advanced option <I>XX</I>.
<P>
This option is used primarily for debugging.
It sets the value of an internal variable to an integer value.
An example usage would be:
<tt>-o useFEAT=0,useCLNT=1</tt>
which in this case, disables use of the
FEAT command and enables use of the CLNT command.
The available variables include:
<tt>usePASV</tt>,
<tt>useSIZE</tt>,
<tt>useMDTM</tt>,
<tt>useREST</tt>,
<tt>useNLST_a</tt>,
<tt>useNLST_d</tt>,
<tt>useFEAT</tt>,
<tt>useMLSD</tt>,
<tt>useMLST</tt>,
<tt>useCLNT</tt>,
<tt>useHELP_SITE</tt>,
<tt>useSITE_UTIME</tt>,
<tt>STATfileParamWorks</tt>,
<tt>NLSTfileParamWorks</tt>,
<tt>require20</tt>,
<tt>allowProxyForPORT</tt>,
<tt>doNotGetStartCWD</tt>.
</DD>

</blockquote>

<H2>Description</H2>

<P>
The purpose of <I>ncftpput</I> is to do file transfers from the command-line without
entering an interactive shell. This lets you write shell scripts or other
unattended processes that can do FTP. It is also useful for advanced users
who want to send files from the shell command line without entering an
interactive FTP program such as <I>ncftp</I>. <P>
By default the program tries to open
the remote host and login anonymously, but you can specify a username and
password information. The <B>-u</B> option is used to specify the username to login
as, and the <B>-p</B> option is used to specify the password. If you are running
the program from the shell, you may omit the <B>-p</B> option and the program will
prompt you for the password. <P>
Using the  <B>-u</B> and <B>-p</B> options are not recommended,
because your account information is exposed to anyone who can see your
shell script or your process information.  For example, someone using the
<I>ps</I> program could see your password while the program runs. <P>
You may use the
<B>-f</B> option instead to specify a file with the account information. However,
this is still not secure because anyone who has read access to the information
file can see the account information. Nevertheless, if you choose to use
the <B>-f</B> option the file should look something like this: <blockquote><pre>host sphygmomanometer.ncftp.com
user gleason
pass mypasswd</pre>
</blockquote>
Don't forget to change the permissions on this file so no one else can read
them. <P>
The <B>-d</B> option is very useful when you are trying to diagnose why a
file transfer is failing. It prints out the entire FTP conversation to the
file you specify, so you can get an idea of what went wrong.   If you specify
the special name <I>stdout</I> as the name of the debugging output file, the output
will instead print to the screen. <P>
Using ASCII mode is helpful when the text
format of your host differs from that of the remote host. For example, if
you are sending a text file from a UNIX system to a Windows-based host,
you could use the <B>-a</B> flag which would use ASCII transfer mode so that the
file created on the Windows machine would be in its native text format
instead of the UNIX text format. <P>
You can upload an entire directory tree
of files by using the <B>-R</B> flag. Example: <blockquote><pre>$ ncftpput -R pikachu.nintendo.co.jp /incoming /tmp/stuff</pre>
</blockquote>
This would create a /incoming/stuff hierarchy on the remote host. <P>
The <B>-T</B>
and <B>-S</B> options are useful when you want to upload file to the remote host,
but you don't want to use the destination pathname until the file is complete.
Using these options, you will not destroy a remote file by the same name
until your file is finished. These options are also useful when a remote
process on the remote host polls a specific filename, and you don't want
that process to see that file until you know the file is finished sending.
Here is an example that uploads to the file /pub/incoming/README, using
the filename /pub/incoming/README.tmp as a temporary filename: <blockquote><pre>$ ncftpput -S .tmp bowser.nintendo.co.jp /pub/incoming /a/README</pre>
 </blockquote>
<P>
A neat way to pipe the output
from any local command into a remote file is to use the <B>-c</B> option, which
denotes that you're using <I>stdin</I> as input. The following example shows how
to make a backup and store it on a remote machine: <blockquote><pre>$ tar cf - / | ncftpput -c sonic.sega.co.jp /usr/local/backup.tar</pre>
 </blockquote>
 
<H2>Diagnostics</H2>
<blockquote>
 <P>
<I>ncftpput</I> returns the following
exit values: 
<OL start="0">
<LI>Success. </LI><LI>Could not connect to remote host. </LI><LI>Could not connect
to remote host - timed out. </LI><LI>Transfer failed. </LI><LI>Transfer failed - timed out. </LI><LI>Directory
change failed. </LI><LI>Directory change failed - timed out. </LI><LI>Malformed URL. </LI><LI>Usage error.
</LI><LI>Error in login configuration file. </LI><LI>Library initialization failed. </LI><LI>Session
initialization failed.  </LI>
</OL>

</blockquote>

<H2>Author</H2>
<blockquote>
 <P>
Mike Gleason, <a href="http://www.ncftp.com">NcFTP Software</a>.
</blockquote>
<H2>See Also</H2>
<blockquote>
 <P>
<I>ncftpput(1)</I>, <I>ncftpget(1),</I>
<I>ncftp(1)</I>, <I>ftp(1)</I>, <I>rcp(1)</I>, <I>tftp(1)</I>. <P>
<I>LibNcFTP</I>  (<a href="http://www.ncftp.com/libncftp/">http://www.ncftp.com/libncftp/</a>).
</blockquote>
</BODY></HTML>
